#!/bin/env python
import libgmail

# Connect from behind a proxy www.myproxy.org:3128 using
# proxy authentication user = 'john', password = 'proxy4321'
libgmail.PROXY_URL = 'eswebproxy00.europe.nokia.com:8080'  # Define the proxy 

ga = libgmail.GmailAccount("dionysus.olympus@gmail.com", "fuckurass")
ga.login()
folder = ga.getMessagesByFolder('inbox')

for thread in folder:
    print thread.id, len(thread), thread.subject
    for msg in thread:
        print "  ", msg.id, msg.number, msg.subject
    print msg.source
